package com.szl.group.common.anno;


import java.lang.annotation.*;


/**
 * description:
 * author: shenxiaolong
 * date: 2020/7/01  11:06
 */
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface Retryable {

    /**
     * Exception type that are retryable.
     *
     * @return exception type to retry
     */
    Class<? extends Throwable> value() default RuntimeException.class;

    /**
     * 包含第一次失败
     *
     * @return the maximum number of attempts (including the first failure), defaults to 3
     */
    int maxAttempts() default 3;

    /**
     * 重试的间隔时间
     *
     * @return
     */
    long intervalTimes() default 0L;

    /**
     * 后期考虑增加回调函数
     */

}
